/**
 *
 */
import OpenApi;
import OpenApi.OpenApiUtil;

extends OpenApi;


init(config: OpenApiUtil.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('oosops', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!$isNull(endpoint)) {
    return endpoint;
  }
  
  if (!$isNull(endpointMap) && !$isNull(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return OpenApiUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model AuditPublicTemplateRegistrationRequest {
  auditAction?: string(name='AuditAction'),
  comment?: string(name='Comment'),
  regionId?: string(name='RegionId'),
  registrationId?: string(name='RegistrationId'),
}

model AuditPublicTemplateRegistrationResponseBody = {
  comment?: string(name='Comment'),
  detail?: string(name='Detail'),
  registrationId?: string(name='RegistrationId'),
  requestId?: string(name='RequestId'),
  status?: string(name='Status'),
  templateId?: string(name='TemplateId'),
  templateName?: string(name='TemplateName'),
  templateVersion?: string(name='TemplateVersion'),
}

model AuditPublicTemplateRegistrationResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: AuditPublicTemplateRegistrationResponseBody(name='body'),
}

/**
 * @param request AuditPublicTemplateRegistrationRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return AuditPublicTemplateRegistrationResponse
 */
async function auditPublicTemplateRegistrationWithOptions(request: AuditPublicTemplateRegistrationRequest, runtime: $RuntimeOptions): AuditPublicTemplateRegistrationResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.auditAction)) {
    query['AuditAction'] = request.auditAction;
  }
  if (!$isNull(request.comment)) {
    query['Comment'] = request.comment;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.registrationId)) {
    query['RegistrationId'] = request.registrationId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'AuditPublicTemplateRegistration',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request AuditPublicTemplateRegistrationRequest
 * @return AuditPublicTemplateRegistrationResponse
 */
async function auditPublicTemplateRegistration(request: AuditPublicTemplateRegistrationRequest): AuditPublicTemplateRegistrationResponse {
  var runtime = new $RuntimeOptions{};
  return auditPublicTemplateRegistrationWithOptions(request, runtime);
}

model CreateActionRequest {
  actionName?: string(name='ActionName', description='This parameter is required.'),
  actionType?: string(name='ActionType', description='This parameter is required.'),
  content?: string(name='Content', description='This parameter is required.'),
  popularity?: int32(name='Popularity'),
  regionId?: string(name='RegionId'),
}

model CreateActionResponseBody = {
  actionName?: string(name='ActionName'),
  actionType?: string(name='ActionType'),
  createdDate?: string(name='CreatedDate'),
  description?: string(name='Description'),
  popularity?: int32(name='Popularity'),
  properties?: string(name='Properties'),
  requestId?: string(name='RequestId'),
  templateVersion?: string(name='TemplateVersion'),
}

model CreateActionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreateActionResponseBody(name='body'),
}

/**
 * @param request CreateActionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreateActionResponse
 */
async function createActionWithOptions(request: CreateActionRequest, runtime: $RuntimeOptions): CreateActionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.actionName)) {
    query['ActionName'] = request.actionName;
  }
  if (!$isNull(request.actionType)) {
    query['ActionType'] = request.actionType;
  }
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.popularity)) {
    query['Popularity'] = request.popularity;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreateAction',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreateActionRequest
 * @return CreateActionResponse
 */
async function createAction(request: CreateActionRequest): CreateActionResponse {
  var runtime = new $RuntimeOptions{};
  return createActionWithOptions(request, runtime);
}

model CreatePublicParameterRequest {
  clientToken?: string(name='ClientToken'),
  constraints?: string(name='Constraints'),
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  parameterType?: string(name='ParameterType', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  value?: string(name='Value', description='This parameter is required.'),
}

model CreatePublicParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    id?: string(name='Id'),
    name?: string(name='Name'),
    parameterVersion?: int32(name='ParameterVersion'),
    regionId?: string(name='RegionId'),
    shareType?: string(name='ShareType'),
    type?: string(name='Type'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Parameter'),
  requestId?: string(name='RequestId'),
}

model CreatePublicParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePublicParameterResponseBody(name='body'),
}

/**
 * @summary 创建一个公共参数。
 *
 * @param request CreatePublicParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePublicParameterResponse
 */
async function createPublicParameterWithOptions(request: CreatePublicParameterRequest, runtime: $RuntimeOptions): CreatePublicParameterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.constraints)) {
    query['Constraints'] = request.constraints;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.parameterType)) {
    query['ParameterType'] = request.parameterType;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreatePublicParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 创建一个公共参数。
 *
 * @param request CreatePublicParameterRequest
 * @return CreatePublicParameterResponse
 */
async function createPublicParameter(request: CreatePublicParameterRequest): CreatePublicParameterResponse {
  var runtime = new $RuntimeOptions{};
  return createPublicParameterWithOptions(request, runtime);
}

model CreatePublicPatchBaselineRequest {
  approvalRules?: string(name='ApprovalRules', description='This parameter is required.'),
  clientToken?: string(name='ClientToken'),
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  operationSystem?: string(name='OperationSystem', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model CreatePublicPatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    id?: string(name='Id'),
    name?: string(name='Name'),
    operationSystem?: string(name='OperationSystem'),
    shareType?: string(name='ShareType'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='PatchBaseline'),
  requestId?: string(name='RequestId'),
}

model CreatePublicPatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePublicPatchBaselineResponseBody(name='body'),
}

/**
 * @param request CreatePublicPatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePublicPatchBaselineResponse
 */
async function createPublicPatchBaselineWithOptions(request: CreatePublicPatchBaselineRequest, runtime: $RuntimeOptions): CreatePublicPatchBaselineResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.approvalRules)) {
    query['ApprovalRules'] = request.approvalRules;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.operationSystem)) {
    query['OperationSystem'] = request.operationSystem;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreatePublicPatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreatePublicPatchBaselineRequest
 * @return CreatePublicPatchBaselineResponse
 */
async function createPublicPatchBaseline(request: CreatePublicPatchBaselineRequest): CreatePublicPatchBaselineResponse {
  var runtime = new $RuntimeOptions{};
  return createPublicPatchBaselineWithOptions(request, runtime);
}

model CreatePublicTemplateRequest {
  category?: string(name='Category'),
  content?: string(name='Content', description='This parameter is required.'),
  isExample?: boolean(name='IsExample'),
  popularity?: int32(name='Popularity'),
  publisher?: string(name='Publisher'),
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
  versionName?: string(name='VersionName'),
}

model CreatePublicTemplateResponseBody = {
  requestId?: string(name='RequestId'),
  template?: {
    category?: string(name='Category'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    hash?: string(name='Hash'),
    popularity?: int32(name='Popularity'),
    shareType?: string(name='ShareType'),
    templateFormat?: string(name='TemplateFormat'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    templateVersion?: string(name='TemplateVersion'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Template'),
}

model CreatePublicTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: CreatePublicTemplateResponseBody(name='body'),
}

/**
 * @param request CreatePublicTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return CreatePublicTemplateResponse
 */
async function createPublicTemplateWithOptions(request: CreatePublicTemplateRequest, runtime: $RuntimeOptions): CreatePublicTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.isExample)) {
    query['IsExample'] = request.isExample;
  }
  if (!$isNull(request.popularity)) {
    query['Popularity'] = request.popularity;
  }
  if (!$isNull(request.publisher)) {
    query['Publisher'] = request.publisher;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.versionName)) {
    query['VersionName'] = request.versionName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'CreatePublicTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request CreatePublicTemplateRequest
 * @return CreatePublicTemplateResponse
 */
async function createPublicTemplate(request: CreatePublicTemplateRequest): CreatePublicTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return createPublicTemplateWithOptions(request, runtime);
}

model DeleteFailureMsgRequest {
  operation?: string(name='Operation', description='This parameter is required.'),
  requestFingerprint?: string(name='RequestFingerprint', description='This parameter is required.'),
}

model DeleteFailureMsgResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeleteFailureMsgResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeleteFailureMsgResponseBody(name='body'),
}

/**
 * @param request DeleteFailureMsgRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeleteFailureMsgResponse
 */
async function deleteFailureMsgWithOptions(request: DeleteFailureMsgRequest, runtime: $RuntimeOptions): DeleteFailureMsgResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.operation)) {
    query['Operation'] = request.operation;
  }
  if (!$isNull(request.requestFingerprint)) {
    query['RequestFingerprint'] = request.requestFingerprint;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeleteFailureMsg',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeleteFailureMsgRequest
 * @return DeleteFailureMsgResponse
 */
async function deleteFailureMsg(request: DeleteFailureMsgRequest): DeleteFailureMsgResponse {
  var runtime = new $RuntimeOptions{};
  return deleteFailureMsgWithOptions(request, runtime);
}

model DeletePublicParameterRequest {
  name?: string(name='Name', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model DeletePublicParameterResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeletePublicParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePublicParameterResponseBody(name='body'),
}

/**
 * @summary 删除公共参数。
 *
 * @param request DeletePublicParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePublicParameterResponse
 */
async function deletePublicParameterWithOptions(request: DeletePublicParameterRequest, runtime: $RuntimeOptions): DeletePublicParameterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeletePublicParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 删除公共参数。
 *
 * @param request DeletePublicParameterRequest
 * @return DeletePublicParameterResponse
 */
async function deletePublicParameter(request: DeletePublicParameterRequest): DeletePublicParameterResponse {
  var runtime = new $RuntimeOptions{};
  return deletePublicParameterWithOptions(request, runtime);
}

model DeletePublicPatchBaselineRequest {
  name?: string(name='Name', description='This parameter is required.'),
}

model DeletePublicPatchBaselineResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeletePublicPatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePublicPatchBaselineResponseBody(name='body'),
}

/**
 * @param request DeletePublicPatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePublicPatchBaselineResponse
 */
async function deletePublicPatchBaselineWithOptions(request: DeletePublicPatchBaselineRequest, runtime: $RuntimeOptions): DeletePublicPatchBaselineResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeletePublicPatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeletePublicPatchBaselineRequest
 * @return DeletePublicPatchBaselineResponse
 */
async function deletePublicPatchBaseline(request: DeletePublicPatchBaselineRequest): DeletePublicPatchBaselineResponse {
  var runtime = new $RuntimeOptions{};
  return deletePublicPatchBaselineWithOptions(request, runtime);
}

model DeletePublicTemplateRequest {
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
}

model DeletePublicTemplateResponseBody = {
  requestId?: string(name='RequestId'),
}

model DeletePublicTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DeletePublicTemplateResponseBody(name='body'),
}

/**
 * @param request DeletePublicTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DeletePublicTemplateResponse
 */
async function deletePublicTemplateWithOptions(request: DeletePublicTemplateRequest, runtime: $RuntimeOptions): DeletePublicTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DeletePublicTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DeletePublicTemplateRequest
 * @return DeletePublicTemplateResponse
 */
async function deletePublicTemplate(request: DeletePublicTemplateRequest): DeletePublicTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return deletePublicTemplateWithOptions(request, runtime);
}

model DoCheckResourceRequest {
  bid?: string(name='bid'),
  country?: string(name='country'),
  gmtWakeup?: string(name='gmtWakeup'),
  hid?: int32(name='hid'),
  interrupt?: boolean(name='interrupt'),
  invoker?: string(name='invoker'),
  level?: int32(name='level'),
  message?: string(name='message'),
  pk?: string(name='pk'),
  prompt?: string(name='prompt'),
  success?: boolean(name='success'),
  taskExtraData?: string(name='taskExtraData'),
  taskIdentifier?: string(name='taskIdentifier'),
  url?: string(name='url'),
}

model DoCheckResourceResponseBody = {
  requestId?: string(name='RequestId'),
  bid?: string(name='bid'),
  country?: string(name='country'),
  gmtWakeup?: string(name='gmtWakeup'),
  hid?: int32(name='hid'),
  interrupt?: boolean(name='interrupt'),
  invoker?: string(name='invoker'),
  level?: int32(name='level'),
  message?: string(name='message'),
  pk?: string(name='pk'),
  prompt?: string(name='prompt'),
  success?: boolean(name='success'),
  taskExtraData?: string(name='taskExtraData'),
  taskIdentifier?: string(name='taskIdentifier'),
  url?: string(name='url'),
}

model DoCheckResourceResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: DoCheckResourceResponseBody(name='body'),
}

/**
 * @param request DoCheckResourceRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return DoCheckResourceResponse
 */
async function doCheckResourceWithOptions(request: DoCheckResourceRequest, runtime: $RuntimeOptions): DoCheckResourceResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.bid)) {
    query['bid'] = request.bid;
  }
  if (!$isNull(request.country)) {
    query['country'] = request.country;
  }
  if (!$isNull(request.gmtWakeup)) {
    query['gmtWakeup'] = request.gmtWakeup;
  }
  if (!$isNull(request.hid)) {
    query['hid'] = request.hid;
  }
  if (!$isNull(request.interrupt)) {
    query['interrupt'] = request.interrupt;
  }
  if (!$isNull(request.invoker)) {
    query['invoker'] = request.invoker;
  }
  if (!$isNull(request.level)) {
    query['level'] = request.level;
  }
  if (!$isNull(request.message)) {
    query['message'] = request.message;
  }
  if (!$isNull(request.pk)) {
    query['pk'] = request.pk;
  }
  if (!$isNull(request.prompt)) {
    query['prompt'] = request.prompt;
  }
  if (!$isNull(request.success)) {
    query['success'] = request.success;
  }
  if (!$isNull(request.taskExtraData)) {
    query['taskExtraData'] = request.taskExtraData;
  }
  if (!$isNull(request.taskIdentifier)) {
    query['taskIdentifier'] = request.taskIdentifier;
  }
  if (!$isNull(request.url)) {
    query['url'] = request.url;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'DoCheckResource',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request DoCheckResourceRequest
 * @return DoCheckResourceResponse
 */
async function doCheckResource(request: DoCheckResourceRequest): DoCheckResourceResponse {
  var runtime = new $RuntimeOptions{};
  return doCheckResourceWithOptions(request, runtime);
}

model GetActionRequest {
  actionName?: string(name='ActionName'),
  regionId?: string(name='RegionId'),
}

model GetActionResponseBody = {
  actionName?: string(name='ActionName'),
  actionType?: string(name='ActionType'),
  content?: bytes(name='Content'),
  createTime?: string(name='CreateTime'),
  modifiedTime?: string(name='ModifiedTime'),
  popularity?: string(name='Popularity'),
  requestId?: string(name='RequestId'),
}

model GetActionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetActionResponseBody(name='body'),
}

/**
 * @summary 获取action的详细信息
 *
 * @param request GetActionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetActionResponse
 */
async function getActionWithOptions(request: GetActionRequest, runtime: $RuntimeOptions): GetActionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.actionName)) {
    query['ActionName'] = request.actionName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetAction',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取action的详细信息
 *
 * @param request GetActionRequest
 * @return GetActionResponse
 */
async function getAction(request: GetActionRequest): GetActionResponse {
  var runtime = new $RuntimeOptions{};
  return getActionWithOptions(request, runtime);
}

model GetFlowControlRequest {
  api?: string(name='Api'),
  service?: string(name='Service'),
  type?: int32(name='Type', description='This parameter is required.'),
  uid?: string(name='Uid'),
}

model GetFlowControlResponseBody = {
  requestId?: string(name='RequestId'),
  value?: int32(name='Value'),
}

model GetFlowControlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetFlowControlResponseBody(name='body'),
}

/**
 * @param request GetFlowControlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetFlowControlResponse
 */
async function getFlowControlWithOptions(request: GetFlowControlRequest, runtime: $RuntimeOptions): GetFlowControlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.api)) {
    query['Api'] = request.api;
  }
  if (!$isNull(request.service)) {
    query['Service'] = request.service;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  if (!$isNull(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetFlowControl',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetFlowControlRequest
 * @return GetFlowControlResponse
 */
async function getFlowControl(request: GetFlowControlRequest): GetFlowControlResponse {
  var runtime = new $RuntimeOptions{};
  return getFlowControlWithOptions(request, runtime);
}

model GetPublicParameterRequest {
  name?: string(name='Name', description='This parameter is required.'),
  parameterVersion?: int32(name='ParameterVersion'),
  regionId?: string(name='RegionId'),
}

model GetPublicParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    id?: string(name='Id'),
    name?: string(name='Name'),
    parameterVersion?: int32(name='ParameterVersion'),
    regionId?: string(name='RegionId'),
    shareType?: string(name='ShareType'),
    type?: string(name='Type'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
    value?: string(name='Value'),
  }(name='Parameter'),
  requestId?: string(name='RequestId'),
}

model GetPublicParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPublicParameterResponseBody(name='body'),
}

/**
 * @summary 获取一个公共参数，包括参数值。
 *
 * @param request GetPublicParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPublicParameterResponse
 */
async function getPublicParameterWithOptions(request: GetPublicParameterRequest, runtime: $RuntimeOptions): GetPublicParameterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.parameterVersion)) {
    query['ParameterVersion'] = request.parameterVersion;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetPublicParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 获取一个公共参数，包括参数值。
 *
 * @param request GetPublicParameterRequest
 * @return GetPublicParameterResponse
 */
async function getPublicParameter(request: GetPublicParameterRequest): GetPublicParameterResponse {
  var runtime = new $RuntimeOptions{};
  return getPublicParameterWithOptions(request, runtime);
}

model GetPublicPatchBaselineRequest {
  name?: string(name='Name', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model GetPublicPatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    id?: string(name='Id'),
    name?: string(name='Name'),
    operationSystem?: string(name='OperationSystem'),
    shareType?: string(name='ShareType'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='PatchBaseline'),
  requestId?: string(name='RequestId'),
}

model GetPublicPatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPublicPatchBaselineResponseBody(name='body'),
}

/**
 * @param request GetPublicPatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPublicPatchBaselineResponse
 */
async function getPublicPatchBaselineWithOptions(request: GetPublicPatchBaselineRequest, runtime: $RuntimeOptions): GetPublicPatchBaselineResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetPublicPatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetPublicPatchBaselineRequest
 * @return GetPublicPatchBaselineResponse
 */
async function getPublicPatchBaseline(request: GetPublicPatchBaselineRequest): GetPublicPatchBaselineResponse {
  var runtime = new $RuntimeOptions{};
  return getPublicPatchBaselineWithOptions(request, runtime);
}

model GetPublicTemplateRequest {
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
  templateVersion?: string(name='TemplateVersion'),
}

model GetPublicTemplateResponseBody = {
  content?: string(name='Content'),
  requestId?: string(name='RequestId'),
  template?: {
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    hash?: string(name='Hash'),
    popularity?: int32(name='Popularity'),
    shareType?: string(name='ShareType'),
    templateFormat?: string(name='TemplateFormat'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    templateVersion?: string(name='TemplateVersion'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Template'),
}

model GetPublicTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetPublicTemplateResponseBody(name='body'),
}

/**
 * @param request GetPublicTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetPublicTemplateResponse
 */
async function getPublicTemplateWithOptions(request: GetPublicTemplateRequest, runtime: $RuntimeOptions): GetPublicTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetPublicTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetPublicTemplateRequest
 * @return GetPublicTemplateResponse
 */
async function getPublicTemplate(request: GetPublicTemplateRequest): GetPublicTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getPublicTemplateWithOptions(request, runtime);
}

model GetQuotaRequest {
  quotaName?: string(name='QuotaName', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  uid?: string(name='Uid', description='This parameter is required.'),
}

model GetQuotaResponseBody = {
  quota?: {
    concurrentExecution?: int32(name='ConcurrentExecution'),
    dailyTasks?: int32(name='DailyTasks'),
    totalTemplate?: int32(name='TotalTemplate'),
  }(name='Quota'),
  requestId?: string(name='RequestId'),
  uid?: string(name='Uid'),
}

model GetQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetQuotaResponseBody(name='body'),
}

/**
 * @param request GetQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetQuotaResponse
 */
async function getQuotaWithOptions(request: GetQuotaRequest, runtime: $RuntimeOptions): GetQuotaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.quotaName)) {
    query['QuotaName'] = request.quotaName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.uid)) {
    query['Uid'] = request.uid;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetQuota',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetQuotaRequest
 * @return GetQuotaResponse
 */
async function getQuota(request: GetQuotaRequest): GetQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return getQuotaWithOptions(request, runtime);
}

model GetUserExecutionTemplateRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  executionId?: string(name='ExecutionId', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model GetUserExecutionTemplateResponseBody = {
  content?: string(name='Content'),
  requestId?: string(name='RequestId'),
  template?: {
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    hash?: string(name='Hash'),
    shareType?: string(name='ShareType'),
    templateFormat?: string(name='TemplateFormat'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    templateVersion?: string(name='TemplateVersion'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Template'),
}

model GetUserExecutionTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserExecutionTemplateResponseBody(name='body'),
}

/**
 * @param request GetUserExecutionTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserExecutionTemplateResponse
 */
async function getUserExecutionTemplateWithOptions(request: GetUserExecutionTemplateRequest, runtime: $RuntimeOptions): GetUserExecutionTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUserExecutionTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetUserExecutionTemplateRequest
 * @return GetUserExecutionTemplateResponse
 */
async function getUserExecutionTemplate(request: GetUserExecutionTemplateRequest): GetUserExecutionTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getUserExecutionTemplateWithOptions(request, runtime);
}

model GetUserTemplateRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
  templateVersion?: string(name='TemplateVersion'),
}

model GetUserTemplateResponseBody = {
  content?: string(name='Content'),
  requestId?: string(name='RequestId'),
  template?: {
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    hash?: string(name='Hash'),
    shareType?: string(name='ShareType'),
    templateFormat?: string(name='TemplateFormat'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    templateVersion?: string(name='TemplateVersion'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Template'),
}

model GetUserTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: GetUserTemplateResponseBody(name='body'),
}

/**
 * @param request GetUserTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return GetUserTemplateResponse
 */
async function getUserTemplateWithOptions(request: GetUserTemplateRequest, runtime: $RuntimeOptions): GetUserTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.templateVersion)) {
    query['TemplateVersion'] = request.templateVersion;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'GetUserTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request GetUserTemplateRequest
 * @return GetUserTemplateResponse
 */
async function getUserTemplate(request: GetUserTemplateRequest): GetUserTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return getUserTemplateWithOptions(request, runtime);
}

model ListActionsRequest {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  OOSActionName?: string(name='OOSActionName'),
  regionId?: string(name='RegionId'),
}

model ListActionsResponseBody = {
  actions?: [ 
    {
      actionType?: string(name='ActionType'),
      createdDate?: string(name='CreatedDate'),
      description?: string(name='Description'),
      OOSActionName?: string(name='OOSActionName'),
      popularity?: int32(name='Popularity'),
      properties?: string(name='Properties'),
      templateVersion?: string(name='TemplateVersion'),
      updateDate?: string(name='UpdateDate'),
    }
  ](name='Actions'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model ListActionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListActionsResponseBody(name='body'),
}

/**
 * @param request ListActionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListActionsResponse
 */
async function listActionsWithOptions(request: ListActionsRequest, runtime: $RuntimeOptions): ListActionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.OOSActionName)) {
    query['OOSActionName'] = request.OOSActionName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListActions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListActionsRequest
 * @return ListActionsResponse
 */
async function listActions(request: ListActionsRequest): ListActionsResponse {
  var runtime = new $RuntimeOptions{};
  return listActionsWithOptions(request, runtime);
}

model ListDefaultQuotaResponseBody = {
  quotas?: [ 
    {
      concurrentExecution?: int32(name='ConcurrentExecution'),
      dailyTasks?: int32(name='DailyTasks'),
      totalTemplate?: int32(name='TotalTemplate'),
    }
  ](name='Quotas'),
  requestId?: string(name='RequestId'),
}

model ListDefaultQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListDefaultQuotaResponseBody(name='body'),
}

/**
 * @param request ListDefaultQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListDefaultQuotaResponse
 */
async function listDefaultQuotaWithOptions(runtime: $RuntimeOptions): ListDefaultQuotaResponse {
  var req = new OpenApiUtil.OpenApiRequest{};
  var params = new OpenApiUtil.Params{
    action = 'ListDefaultQuota',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @return ListDefaultQuotaResponse
 */
async function listDefaultQuota(): ListDefaultQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return listDefaultQuotaWithOptions(runtime);
}

model ListFailureMsgsRequest {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestFingerprint?: string(name='RequestFingerprint'),
}

model ListFailureMsgsResponseBody = {
  failureMsgs?: [ 
    {
      aliUid?: string(name='AliUid'),
      executionId?: string(name='ExecutionId'),
      messageBody?: string(name='MessageBody'),
      reason?: string(name='Reason'),
      taskExecutionId?: string(name='TaskExecutionId'),
    }
  ](name='FailureMsgs'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model ListFailureMsgsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListFailureMsgsResponseBody(name='body'),
}

/**
 * @param request ListFailureMsgsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListFailureMsgsResponse
 */
async function listFailureMsgsWithOptions(request: ListFailureMsgsRequest, runtime: $RuntimeOptions): ListFailureMsgsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.requestFingerprint)) {
    query['RequestFingerprint'] = request.requestFingerprint;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListFailureMsgs',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListFailureMsgsRequest
 * @return ListFailureMsgsResponse
 */
async function listFailureMsgs(request: ListFailureMsgsRequest): ListFailureMsgsResponse {
  var runtime = new $RuntimeOptions{};
  return listFailureMsgsWithOptions(request, runtime);
}

model ListOOSLogsRequest {
  endTime?: string(name='EndTime', description='This parameter is required.'),
  executionId?: string(name='ExecutionId'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  regionId?: string(name='RegionId'),
  requestFingerprint?: string(name='RequestFingerprint'),
  startTime?: string(name='StartTime', description='This parameter is required.'),
}

model ListOOSLogsResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  OOSLogs?: string(name='OOSLogs'),
  requestId?: string(name='RequestId'),
}

model ListOOSLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListOOSLogsResponseBody(name='body'),
}

/**
 * @param request ListOOSLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListOOSLogsResponse
 */
async function listOOSLogsWithOptions(request: ListOOSLogsRequest, runtime: $RuntimeOptions): ListOOSLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.endTime)) {
    query['EndTime'] = request.endTime;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.requestFingerprint)) {
    query['RequestFingerprint'] = request.requestFingerprint;
  }
  if (!$isNull(request.startTime)) {
    query['StartTime'] = request.startTime;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListOOSLogs',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListOOSLogsRequest
 * @return ListOOSLogsResponse
 */
async function listOOSLogs(request: ListOOSLogsRequest): ListOOSLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listOOSLogsWithOptions(request, runtime);
}

model ListPublicParametersRequest {
  createdDateAfter?: string(name='CreatedDateAfter'),
  createdDateBefore?: string(name='CreatedDateBefore'),
  maxResults?: int32(name='MaxResults'),
  name?: string(name='Name'),
  nextToken?: string(name='NextToken'),
  parameterType?: string(name='ParameterType'),
  path?: string(name='Path'),
  recursive?: boolean(name='Recursive'),
  regionId?: string(name='RegionId'),
  sortField?: string(name='SortField'),
  sortOrder?: string(name='SortOrder'),
}

model ListPublicParametersResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  parameters?: [ 
    {
      createdBy?: string(name='CreatedBy'),
      createdDate?: string(name='CreatedDate'),
      description?: string(name='Description'),
      id?: string(name='Id'),
      name?: string(name='Name'),
      parameterVersion?: string(name='ParameterVersion'),
      regionId?: string(name='RegionId'),
      shareType?: string(name='ShareType'),
      type?: string(name='Type'),
      updatedBy?: string(name='UpdatedBy'),
      updatedDate?: string(name='UpdatedDate'),
    }
  ](name='Parameters'),
  requestId?: string(name='RequestId'),
  totalCount?: int32(name='TotalCount'),
}

model ListPublicParametersResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPublicParametersResponseBody(name='body'),
}

/**
 * @summary 查询公共参数。支持多种查询
 *
 * @param request ListPublicParametersRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPublicParametersResponse
 */
async function listPublicParametersWithOptions(request: ListPublicParametersRequest, runtime: $RuntimeOptions): ListPublicParametersResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.createdDateAfter)) {
    query['CreatedDateAfter'] = request.createdDateAfter;
  }
  if (!$isNull(request.createdDateBefore)) {
    query['CreatedDateBefore'] = request.createdDateBefore;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.parameterType)) {
    query['ParameterType'] = request.parameterType;
  }
  if (!$isNull(request.path)) {
    query['Path'] = request.path;
  }
  if (!$isNull(request.recursive)) {
    query['Recursive'] = request.recursive;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPublicParameters',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 查询公共参数。支持多种查询
 *
 * @param request ListPublicParametersRequest
 * @return ListPublicParametersResponse
 */
async function listPublicParameters(request: ListPublicParametersRequest): ListPublicParametersResponse {
  var runtime = new $RuntimeOptions{};
  return listPublicParametersWithOptions(request, runtime);
}

model ListPublicPatchBaselinesRequest {
  maxResults?: int32(name='MaxResults'),
  name?: string(name='Name'),
  nextToken?: string(name='NextToken'),
  operationSystem?: string(name='OperationSystem'),
  regionId?: string(name='RegionId'),
  shareType?: string(name='ShareType'),
}

model ListPublicPatchBaselinesResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  patchBaselines?: [ 
    {
      createdBy?: string(name='CreatedBy'),
      createdDate?: string(name='CreatedDate'),
      description?: string(name='Description'),
      id?: string(name='Id'),
      isDefault?: boolean(name='IsDefault'),
      name?: string(name='Name'),
      operationSystem?: string(name='OperationSystem'),
      shareType?: string(name='ShareType'),
      updatedBy?: string(name='UpdatedBy'),
      updatedDate?: string(name='UpdatedDate'),
    }
  ](name='PatchBaselines'),
  requestId?: string(name='RequestId'),
}

model ListPublicPatchBaselinesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPublicPatchBaselinesResponseBody(name='body'),
}

/**
 * @param request ListPublicPatchBaselinesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPublicPatchBaselinesResponse
 */
async function listPublicPatchBaselinesWithOptions(request: ListPublicPatchBaselinesRequest, runtime: $RuntimeOptions): ListPublicPatchBaselinesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.operationSystem)) {
    query['OperationSystem'] = request.operationSystem;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPublicPatchBaselines',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListPublicPatchBaselinesRequest
 * @return ListPublicPatchBaselinesResponse
 */
async function listPublicPatchBaselines(request: ListPublicPatchBaselinesRequest): ListPublicPatchBaselinesResponse {
  var runtime = new $RuntimeOptions{};
  return listPublicPatchBaselinesWithOptions(request, runtime);
}

model ListPublicTemplateRegistrationsRequest {
  maxResults?: long(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  regionId?: string(name='RegionId'),
  registrationId?: string(name='RegistrationId'),
  status?: string(name='Status'),
  templateName?: string(name='TemplateName'),
}

model ListPublicTemplateRegistrationsResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  registrations?: [ 
    {
      comment?: string(name='Comment'),
      createdDate?: string(name='CreatedDate'),
      detail?: string(name='Detail'),
      registrationId?: string(name='RegistrationId'),
      showPages?: string(name='ShowPages'),
      status?: string(name='Status'),
      templateId?: string(name='TemplateId'),
      templateName?: string(name='TemplateName'),
      templateVersion?: string(name='TemplateVersion'),
      updatedDate?: string(name='UpdatedDate'),
    }
  ](name='Registrations'),
  requestId?: string(name='RequestId'),
}

model ListPublicTemplateRegistrationsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPublicTemplateRegistrationsResponseBody(name='body'),
}

/**
 * @param request ListPublicTemplateRegistrationsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPublicTemplateRegistrationsResponse
 */
async function listPublicTemplateRegistrationsWithOptions(request: ListPublicTemplateRegistrationsRequest, runtime: $RuntimeOptions): ListPublicTemplateRegistrationsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.registrationId)) {
    query['RegistrationId'] = request.registrationId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPublicTemplateRegistrations',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListPublicTemplateRegistrationsRequest
 * @return ListPublicTemplateRegistrationsResponse
 */
async function listPublicTemplateRegistrations(request: ListPublicTemplateRegistrationsRequest): ListPublicTemplateRegistrationsResponse {
  var runtime = new $RuntimeOptions{};
  return listPublicTemplateRegistrationsWithOptions(request, runtime);
}

model ListPublicTemplatesRequest {
  createdBy?: string(name='CreatedBy'),
  createdDateAfter?: string(name='CreatedDateAfter'),
  createdDateBefore?: string(name='CreatedDateBefore'),
  isExample?: boolean(name='IsExample'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  popularity?: int32(name='Popularity'),
  regionId?: string(name='RegionId'),
  shareType?: string(name='ShareType'),
  sortField?: string(name='SortField'),
  sortOrder?: string(name='SortOrder'),
  templateFormat?: string(name='TemplateFormat'),
  templateName?: string(name='TemplateName'),
}

model ListPublicTemplatesResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  templates?: [ 
    {
      createdBy?: string(name='CreatedBy'),
      createdDate?: string(name='CreatedDate'),
      description?: string(name='Description'),
      hash?: string(name='Hash'),
      popularity?: int32(name='Popularity'),
      shareType?: string(name='ShareType'),
      templateFormat?: string(name='TemplateFormat'),
      templateId?: string(name='TemplateId'),
      templateName?: string(name='TemplateName'),
      templateVersion?: string(name='TemplateVersion'),
      totalExecutionCount?: int32(name='TotalExecutionCount'),
      updatedBy?: string(name='UpdatedBy'),
      updatedDate?: string(name='UpdatedDate'),
    }
  ](name='Templates'),
}

model ListPublicTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListPublicTemplatesResponseBody(name='body'),
}

/**
 * @param request ListPublicTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListPublicTemplatesResponse
 */
async function listPublicTemplatesWithOptions(request: ListPublicTemplatesRequest, runtime: $RuntimeOptions): ListPublicTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.createdBy)) {
    query['CreatedBy'] = request.createdBy;
  }
  if (!$isNull(request.createdDateAfter)) {
    query['CreatedDateAfter'] = request.createdDateAfter;
  }
  if (!$isNull(request.createdDateBefore)) {
    query['CreatedDateBefore'] = request.createdDateBefore;
  }
  if (!$isNull(request.isExample)) {
    query['IsExample'] = request.isExample;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.popularity)) {
    query['Popularity'] = request.popularity;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!$isNull(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.templateFormat)) {
    query['TemplateFormat'] = request.templateFormat;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListPublicTemplates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListPublicTemplatesRequest
 * @return ListPublicTemplatesResponse
 */
async function listPublicTemplates(request: ListPublicTemplatesRequest): ListPublicTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return listPublicTemplatesWithOptions(request, runtime);
}

model ListUserExecutionLogsRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  executionId?: string(name='ExecutionId', description='This parameter is required.'),
  logType?: string(name='LogType'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  regionId?: string(name='RegionId'),
  taskExecutionId?: string(name='TaskExecutionId'),
}

model ListUserExecutionLogsResponseBody = {
  executionLogs?: [ 
    {
      logType?: string(name='LogType'),
      message?: string(name='Message'),
      taskExecutionId?: string(name='TaskExecutionId'),
      timestamp?: string(name='Timestamp'),
    }
  ](name='ExecutionLogs'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model ListUserExecutionLogsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserExecutionLogsResponseBody(name='body'),
}

/**
 * @param request ListUserExecutionLogsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserExecutionLogsResponse
 */
async function listUserExecutionLogsWithOptions(request: ListUserExecutionLogsRequest, runtime: $RuntimeOptions): ListUserExecutionLogsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.logType)) {
    query['LogType'] = request.logType;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.taskExecutionId)) {
    query['TaskExecutionId'] = request.taskExecutionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserExecutionLogs',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserExecutionLogsRequest
 * @return ListUserExecutionLogsResponse
 */
async function listUserExecutionLogs(request: ListUserExecutionLogsRequest): ListUserExecutionLogsResponse {
  var runtime = new $RuntimeOptions{};
  return listUserExecutionLogsWithOptions(request, runtime);
}

model ListUserExecutionsRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  endDateAfter?: string(name='EndDateAfter'),
  endDateBefore?: string(name='EndDateBefore'),
  executedBy?: string(name='ExecutedBy'),
  executionId?: string(name='ExecutionId'),
  includeChildExecution?: boolean(name='IncludeChildExecution'),
  maxResults?: int32(name='MaxResults'),
  mode?: string(name='Mode'),
  nextToken?: string(name='NextToken'),
  parentExecutionId?: string(name='ParentExecutionId'),
  ramRole?: string(name='RamRole'),
  regionId?: string(name='RegionId'),
  sortField?: string(name='SortField'),
  sortOrder?: string(name='SortOrder'),
  startDateAfter?: string(name='StartDateAfter'),
  startDateBefore?: string(name='StartDateBefore'),
  status?: string(name='Status'),
  templateName?: string(name='TemplateName'),
}

model ListUserExecutionsResponseBody = {
  executions?: [ 
    {
      counters?: string(name='Counters'),
      createDate?: string(name='CreateDate'),
      currentTasks?: [ 
        {
          taskAction?: string(name='TaskAction'),
          taskExecutionId?: string(name='TaskExecutionId'),
          taskName?: string(name='TaskName'),
        }
      ](name='CurrentTasks'),
      endDate?: string(name='EndDate'),
      executedBy?: string(name='ExecutedBy'),
      executionId?: string(name='ExecutionId'),
      isParent?: boolean(name='IsParent'),
      mode?: string(name='Mode'),
      outputs?: string(name='Outputs'),
      parameters?: string(name='Parameters'),
      parentExecutionId?: string(name='ParentExecutionId'),
      ramRole?: string(name='RamRole'),
      safetyCheck?: string(name='SafetyCheck'),
      startDate?: string(name='StartDate'),
      status?: string(name='Status'),
      statusMessage?: string(name='StatusMessage'),
      templateId?: string(name='TemplateId'),
      templateName?: string(name='TemplateName'),
      templateVersion?: string(name='TemplateVersion'),
      updateDate?: string(name='UpdateDate'),
      waitingStatus?: string(name='WaitingStatus'),
    }
  ](name='Executions'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model ListUserExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserExecutionsResponseBody(name='body'),
}

/**
 * @param request ListUserExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserExecutionsResponse
 */
async function listUserExecutionsWithOptions(request: ListUserExecutionsRequest, runtime: $RuntimeOptions): ListUserExecutionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.endDateAfter)) {
    query['EndDateAfter'] = request.endDateAfter;
  }
  if (!$isNull(request.endDateBefore)) {
    query['EndDateBefore'] = request.endDateBefore;
  }
  if (!$isNull(request.executedBy)) {
    query['ExecutedBy'] = request.executedBy;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.includeChildExecution)) {
    query['IncludeChildExecution'] = request.includeChildExecution;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.mode)) {
    query['Mode'] = request.mode;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.parentExecutionId)) {
    query['ParentExecutionId'] = request.parentExecutionId;
  }
  if (!$isNull(request.ramRole)) {
    query['RamRole'] = request.ramRole;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.startDateAfter)) {
    query['StartDateAfter'] = request.startDateAfter;
  }
  if (!$isNull(request.startDateBefore)) {
    query['StartDateBefore'] = request.startDateBefore;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserExecutions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserExecutionsRequest
 * @return ListUserExecutionsResponse
 */
async function listUserExecutions(request: ListUserExecutionsRequest): ListUserExecutionsResponse {
  var runtime = new $RuntimeOptions{};
  return listUserExecutionsWithOptions(request, runtime);
}

model ListUserInstancePatchStatesRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  instanceIds?: string(name='InstanceIds', description='This parameter is required.'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  regionId?: string(name='RegionId'),
}

model ListUserInstancePatchStatesResponseBody = {
  instancePatchStates?: [ 
    {
      baselineId?: string(name='BaselineId'),
      failedCount?: string(name='FailedCount'),
      installedCount?: string(name='InstalledCount'),
      installedOtherCount?: string(name='InstalledOtherCount'),
      installedPendingRebootCount?: string(name='InstalledPendingRebootCount'),
      installedRejectedCount?: string(name='InstalledRejectedCount'),
      instanceId?: string(name='InstanceId'),
      missingCount?: string(name='MissingCount'),
      operationEndTime?: string(name='OperationEndTime'),
      operationStartTime?: string(name='OperationStartTime'),
      operationType?: string(name='OperationType'),
      ownerInformation?: string(name='OwnerInformation'),
      patchGroup?: string(name='PatchGroup'),
    }
  ](name='InstancePatchStates'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
}

model ListUserInstancePatchStatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserInstancePatchStatesResponseBody(name='body'),
}

/**
 * @param request ListUserInstancePatchStatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserInstancePatchStatesResponse
 */
async function listUserInstancePatchStatesWithOptions(request: ListUserInstancePatchStatesRequest, runtime: $RuntimeOptions): ListUserInstancePatchStatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.instanceIds)) {
    query['InstanceIds'] = request.instanceIds;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserInstancePatchStates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserInstancePatchStatesRequest
 * @return ListUserInstancePatchStatesResponse
 */
async function listUserInstancePatchStates(request: ListUserInstancePatchStatesRequest): ListUserInstancePatchStatesResponse {
  var runtime = new $RuntimeOptions{};
  return listUserInstancePatchStatesWithOptions(request, runtime);
}

model ListUserInstancePatchesRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  regionId?: string(name='RegionId'),
}

model ListUserInstancePatchesResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  patches?: [ 
    {
      classification?: string(name='Classification'),
      installedTime?: string(name='InstalledTime'),
      KBId?: string(name='KBId'),
      severity?: string(name='Severity'),
      status?: string(name='Status'),
      title?: string(name='Title'),
    }
  ](name='Patches'),
  requestId?: string(name='RequestId'),
}

model ListUserInstancePatchesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserInstancePatchesResponseBody(name='body'),
}

/**
 * @param request ListUserInstancePatchesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserInstancePatchesResponse
 */
async function listUserInstancePatchesWithOptions(request: ListUserInstancePatchesRequest, runtime: $RuntimeOptions): ListUserInstancePatchesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserInstancePatches',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserInstancePatchesRequest
 * @return ListUserInstancePatchesResponse
 */
async function listUserInstancePatches(request: ListUserInstancePatchesRequest): ListUserInstancePatchesResponse {
  var runtime = new $RuntimeOptions{};
  return listUserInstancePatchesWithOptions(request, runtime);
}

model ListUserInventoryEntriesRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  filter?: [ 
    {
      name?: string(name='Name'),
      operator?: string(name='Operator'),
      value?: [ string ](name='Value'),
    }
  ](name='Filter'),
  instanceId?: string(name='InstanceId', description='This parameter is required.'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  regionId?: string(name='RegionId'),
  typeName?: string(name='TypeName', description='This parameter is required.'),
}

model ListUserInventoryEntriesResponseBody = {
  captureTime?: string(name='CaptureTime'),
  entries?: [  map[string]any ](name='Entries'),
  instanceId?: string(name='InstanceId'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  schemaVersion?: string(name='SchemaVersion'),
  typeName?: string(name='TypeName'),
}

model ListUserInventoryEntriesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserInventoryEntriesResponseBody(name='body'),
}

/**
 * @param request ListUserInventoryEntriesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserInventoryEntriesResponse
 */
async function listUserInventoryEntriesWithOptions(request: ListUserInventoryEntriesRequest, runtime: $RuntimeOptions): ListUserInventoryEntriesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.filter)) {
    query['Filter'] = request.filter;
  }
  if (!$isNull(request.instanceId)) {
    query['InstanceId'] = request.instanceId;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.typeName)) {
    query['TypeName'] = request.typeName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserInventoryEntries',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserInventoryEntriesRequest
 * @return ListUserInventoryEntriesResponse
 */
async function listUserInventoryEntries(request: ListUserInventoryEntriesRequest): ListUserInventoryEntriesResponse {
  var runtime = new $RuntimeOptions{};
  return listUserInventoryEntriesWithOptions(request, runtime);
}

model ListUserTaskExecutionsRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  endDateAfter?: string(name='EndDateAfter'),
  endDateBefore?: string(name='EndDateBefore'),
  executionId?: string(name='ExecutionId'),
  includeChildTaskExecution?: boolean(name='IncludeChildTaskExecution'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  parentTaskExecutionId?: string(name='ParentTaskExecutionId'),
  regionId?: string(name='RegionId'),
  sortField?: string(name='SortField'),
  sortOrder?: string(name='SortOrder'),
  startDateAfter?: string(name='StartDateAfter'),
  startDateBefore?: string(name='StartDateBefore'),
  status?: string(name='Status'),
  taskAction?: string(name='TaskAction'),
  taskExecutionId?: string(name='TaskExecutionId'),
  taskName?: string(name='TaskName'),
}

model ListUserTaskExecutionsResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  taskExecutions?: [ 
    {
      childExecutionId?: string(name='ChildExecutionId'),
      createDate?: string(name='CreateDate'),
      endDate?: string(name='EndDate'),
      executionId?: string(name='ExecutionId'),
      extraData?: string(name='ExtraData'),
      loop?: string(name='Loop'),
      loopBatchNumber?: int32(name='LoopBatchNumber'),
      loopItem?: string(name='LoopItem'),
      outputs?: string(name='Outputs'),
      parentTaskExecutionId?: string(name='ParentTaskExecutionId'),
      properties?: string(name='Properties'),
      startDate?: string(name='StartDate'),
      status?: string(name='Status'),
      statusMessage?: string(name='StatusMessage'),
      taskAction?: string(name='TaskAction'),
      taskExecutionId?: string(name='TaskExecutionId'),
      taskName?: string(name='TaskName'),
      templateId?: string(name='TemplateId'),
      updateDate?: string(name='UpdateDate'),
    }
  ](name='TaskExecutions'),
}

model ListUserTaskExecutionsResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserTaskExecutionsResponseBody(name='body'),
}

/**
 * @param request ListUserTaskExecutionsRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserTaskExecutionsResponse
 */
async function listUserTaskExecutionsWithOptions(request: ListUserTaskExecutionsRequest, runtime: $RuntimeOptions): ListUserTaskExecutionsResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.endDateAfter)) {
    query['EndDateAfter'] = request.endDateAfter;
  }
  if (!$isNull(request.endDateBefore)) {
    query['EndDateBefore'] = request.endDateBefore;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.includeChildTaskExecution)) {
    query['IncludeChildTaskExecution'] = request.includeChildTaskExecution;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.parentTaskExecutionId)) {
    query['ParentTaskExecutionId'] = request.parentTaskExecutionId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.startDateAfter)) {
    query['StartDateAfter'] = request.startDateAfter;
  }
  if (!$isNull(request.startDateBefore)) {
    query['StartDateBefore'] = request.startDateBefore;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  if (!$isNull(request.taskAction)) {
    query['TaskAction'] = request.taskAction;
  }
  if (!$isNull(request.taskExecutionId)) {
    query['TaskExecutionId'] = request.taskExecutionId;
  }
  if (!$isNull(request.taskName)) {
    query['TaskName'] = request.taskName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserTaskExecutions',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserTaskExecutionsRequest
 * @return ListUserTaskExecutionsResponse
 */
async function listUserTaskExecutions(request: ListUserTaskExecutionsRequest): ListUserTaskExecutionsResponse {
  var runtime = new $RuntimeOptions{};
  return listUserTaskExecutionsWithOptions(request, runtime);
}

model ListUserTemplatesRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  category?: string(name='Category'),
  createdBy?: string(name='CreatedBy'),
  createdDateAfter?: string(name='CreatedDateAfter'),
  createdDateBefore?: string(name='CreatedDateBefore'),
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  popularity?: int32(name='Popularity'),
  regionId?: string(name='RegionId'),
  shareType?: string(name='ShareType'),
  sortField?: string(name='SortField'),
  sortOrder?: string(name='SortOrder'),
  templateFormat?: string(name='TemplateFormat'),
  templateName?: string(name='TemplateName'),
  templateType?: string(name='TemplateType'),
}

model ListUserTemplatesResponseBody = {
  maxResults?: int32(name='MaxResults'),
  nextToken?: string(name='NextToken'),
  requestId?: string(name='RequestId'),
  templates?: [ 
    {
      createdBy?: string(name='CreatedBy'),
      createdDate?: string(name='CreatedDate'),
      description?: string(name='Description'),
      hash?: string(name='Hash'),
      popularity?: int32(name='Popularity'),
      shareType?: string(name='ShareType'),
      templateFormat?: string(name='TemplateFormat'),
      templateId?: string(name='TemplateId'),
      templateName?: string(name='TemplateName'),
      templateVersion?: string(name='TemplateVersion'),
      totalExecutionCount?: int32(name='TotalExecutionCount'),
      updatedBy?: string(name='UpdatedBy'),
      updatedDate?: string(name='UpdatedDate'),
    }
  ](name='Templates'),
}

model ListUserTemplatesResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ListUserTemplatesResponseBody(name='body'),
}

/**
 * @param request ListUserTemplatesRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ListUserTemplatesResponse
 */
async function listUserTemplatesWithOptions(request: ListUserTemplatesRequest, runtime: $RuntimeOptions): ListUserTemplatesResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.createdBy)) {
    query['CreatedBy'] = request.createdBy;
  }
  if (!$isNull(request.createdDateAfter)) {
    query['CreatedDateAfter'] = request.createdDateAfter;
  }
  if (!$isNull(request.createdDateBefore)) {
    query['CreatedDateBefore'] = request.createdDateBefore;
  }
  if (!$isNull(request.maxResults)) {
    query['MaxResults'] = request.maxResults;
  }
  if (!$isNull(request.nextToken)) {
    query['NextToken'] = request.nextToken;
  }
  if (!$isNull(request.popularity)) {
    query['Popularity'] = request.popularity;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.shareType)) {
    query['ShareType'] = request.shareType;
  }
  if (!$isNull(request.sortField)) {
    query['SortField'] = request.sortField;
  }
  if (!$isNull(request.sortOrder)) {
    query['SortOrder'] = request.sortOrder;
  }
  if (!$isNull(request.templateFormat)) {
    query['TemplateFormat'] = request.templateFormat;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.templateType)) {
    query['TemplateType'] = request.templateType;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ListUserTemplates',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ListUserTemplatesRequest
 * @return ListUserTemplatesResponse
 */
async function listUserTemplates(request: ListUserTemplatesRequest): ListUserTemplatesResponse {
  var runtime = new $RuntimeOptions{};
  return listUserTemplatesWithOptions(request, runtime);
}

model ResetTimerTriggerExecutionRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  executionId?: string(name='ExecutionId', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model ResetTimerTriggerExecutionResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetTimerTriggerExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetTimerTriggerExecutionResponseBody(name='body'),
}

/**
 * @param request ResetTimerTriggerExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetTimerTriggerExecutionResponse
 */
async function resetTimerTriggerExecutionWithOptions(request: ResetTimerTriggerExecutionRequest, runtime: $RuntimeOptions): ResetTimerTriggerExecutionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetTimerTriggerExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResetTimerTriggerExecutionRequest
 * @return ResetTimerTriggerExecutionResponse
 */
async function resetTimerTriggerExecution(request: ResetTimerTriggerExecutionRequest): ResetTimerTriggerExecutionResponse {
  var runtime = new $RuntimeOptions{};
  return resetTimerTriggerExecutionWithOptions(request, runtime);
}

model ResetUserExecutionRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  executionId?: string(name='ExecutionId', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  status?: string(name='Status'),
}

model ResetUserExecutionResponseBody = {
  requestId?: string(name='RequestId'),
}

model ResetUserExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ResetUserExecutionResponseBody(name='body'),
}

/**
 * @param request ResetUserExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ResetUserExecutionResponse
 */
async function resetUserExecutionWithOptions(request: ResetUserExecutionRequest, runtime: $RuntimeOptions): ResetUserExecutionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.status)) {
    query['Status'] = request.status;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ResetUserExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ResetUserExecutionRequest
 * @return ResetUserExecutionResponse
 */
async function resetUserExecution(request: ResetUserExecutionRequest): ResetUserExecutionResponse {
  var runtime = new $RuntimeOptions{};
  return resetUserExecutionWithOptions(request, runtime);
}

model SetFlowControlRequest {
  api?: string(name='Api'),
  service?: string(name='Service'),
  type?: int32(name='Type', description='This parameter is required.'),
  uid?: string(name='Uid'),
  value?: int32(name='Value', description='This parameter is required.'),
}

model SetFlowControlResponseBody = {
  requestId?: string(name='RequestId'),
}

model SetFlowControlResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetFlowControlResponseBody(name='body'),
}

/**
 * @param request SetFlowControlRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetFlowControlResponse
 */
async function setFlowControlWithOptions(request: SetFlowControlRequest, runtime: $RuntimeOptions): SetFlowControlResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.api)) {
    query['Api'] = request.api;
  }
  if (!$isNull(request.service)) {
    query['Service'] = request.service;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  if (!$isNull(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetFlowControl',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SetFlowControlRequest
 * @return SetFlowControlResponse
 */
async function setFlowControl(request: SetFlowControlRequest): SetFlowControlResponse {
  var runtime = new $RuntimeOptions{};
  return setFlowControlWithOptions(request, runtime);
}

model SetQuotaRequest {
  quotaName?: string(name='QuotaName', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  uid?: string(name='Uid', description='This parameter is required.'),
  value?: string(name='Value', description='This parameter is required.'),
}

model SetQuotaResponseBody = {
  quota?: int32(name='Quota'),
  requestId?: string(name='RequestId'),
  uid?: string(name='Uid'),
}

model SetQuotaResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: SetQuotaResponseBody(name='body'),
}

/**
 * @param request SetQuotaRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return SetQuotaResponse
 */
async function setQuotaWithOptions(request: SetQuotaRequest, runtime: $RuntimeOptions): SetQuotaResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.quotaName)) {
    query['QuotaName'] = request.quotaName;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.uid)) {
    query['Uid'] = request.uid;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'SetQuota',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request SetQuotaRequest
 * @return SetQuotaResponse
 */
async function setQuota(request: SetQuotaRequest): SetQuotaResponse {
  var runtime = new $RuntimeOptions{};
  return setQuotaWithOptions(request, runtime);
}

model TerminateUserExecutionRequest {
  aliUid?: string(name='AliUid', description='This parameter is required.'),
  executionId?: string(name='ExecutionId', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model TerminateUserExecutionResponseBody = {
  requestId?: string(name='RequestId'),
}

model TerminateUserExecutionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: TerminateUserExecutionResponseBody(name='body'),
}

/**
 * @param request TerminateUserExecutionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return TerminateUserExecutionResponse
 */
async function terminateUserExecutionWithOptions(request: TerminateUserExecutionRequest, runtime: $RuntimeOptions): TerminateUserExecutionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.aliUid)) {
    query['AliUid'] = request.aliUid;
  }
  if (!$isNull(request.executionId)) {
    query['ExecutionId'] = request.executionId;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'TerminateUserExecution',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request TerminateUserExecutionRequest
 * @return TerminateUserExecutionResponse
 */
async function terminateUserExecution(request: TerminateUserExecutionRequest): TerminateUserExecutionResponse {
  var runtime = new $RuntimeOptions{};
  return terminateUserExecutionWithOptions(request, runtime);
}

model UpdateActionRequest {
  actionName?: string(name='ActionName', description='This parameter is required.'),
  actionType?: string(name='ActionType', description='This parameter is required.'),
  content?: string(name='Content', description='This parameter is required.'),
  popularity?: int32(name='Popularity'),
  regionId?: string(name='RegionId'),
}

model UpdateActionResponseBody = {
  actionName?: string(name='ActionName'),
  actionType?: string(name='ActionType'),
  createdDate?: string(name='CreatedDate'),
  description?: string(name='Description'),
  popularity?: int32(name='Popularity'),
  properties?: string(name='Properties'),
  requestId?: string(name='RequestId'),
  templateVersion?: string(name='TemplateVersion'),
}

model UpdateActionResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdateActionResponseBody(name='body'),
}

/**
 * @param request UpdateActionRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdateActionResponse
 */
async function updateActionWithOptions(request: UpdateActionRequest, runtime: $RuntimeOptions): UpdateActionResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.actionName)) {
    query['ActionName'] = request.actionName;
  }
  if (!$isNull(request.actionType)) {
    query['ActionType'] = request.actionType;
  }
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.popularity)) {
    query['Popularity'] = request.popularity;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdateAction',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdateActionRequest
 * @return UpdateActionResponse
 */
async function updateAction(request: UpdateActionRequest): UpdateActionResponse {
  var runtime = new $RuntimeOptions{};
  return updateActionWithOptions(request, runtime);
}

model UpdatePublicParameterRequest {
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  value?: string(name='Value', description='This parameter is required.'),
}

model UpdatePublicParameterResponseBody = {
  parameter?: {
    constraints?: string(name='Constraints'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    id?: string(name='Id'),
    name?: string(name='Name'),
    parameterVersion?: int32(name='ParameterVersion'),
    regionId?: string(name='RegionId'),
    shareType?: string(name='ShareType'),
    type?: string(name='Type'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Parameter'),
  requestId?: string(name='RequestId'),
}

model UpdatePublicParameterResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePublicParameterResponseBody(name='body'),
}

/**
 * @summary 更新一个已存在的公共参数。
 *
 * @param request UpdatePublicParameterRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePublicParameterResponse
 */
async function updatePublicParameterWithOptions(request: UpdatePublicParameterRequest, runtime: $RuntimeOptions): UpdatePublicParameterResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.value)) {
    query['Value'] = request.value;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdatePublicParameter',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @summary 更新一个已存在的公共参数。
 *
 * @param request UpdatePublicParameterRequest
 * @return UpdatePublicParameterResponse
 */
async function updatePublicParameter(request: UpdatePublicParameterRequest): UpdatePublicParameterResponse {
  var runtime = new $RuntimeOptions{};
  return updatePublicParameterWithOptions(request, runtime);
}

model UpdatePublicPatchBaselineRequest {
  approvalRules?: string(name='ApprovalRules'),
  clientToken?: string(name='ClientToken'),
  description?: string(name='Description'),
  name?: string(name='Name', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
}

model UpdatePublicPatchBaselineResponseBody = {
  patchBaseline?: {
    approvalRules?: string(name='ApprovalRules'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    id?: string(name='Id'),
    name?: string(name='Name'),
    operationSystem?: string(name='OperationSystem'),
    shareType?: string(name='ShareType'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='PatchBaseline'),
  requestId?: string(name='RequestId'),
}

model UpdatePublicPatchBaselineResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePublicPatchBaselineResponseBody(name='body'),
}

/**
 * @param request UpdatePublicPatchBaselineRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePublicPatchBaselineResponse
 */
async function updatePublicPatchBaselineWithOptions(request: UpdatePublicPatchBaselineRequest, runtime: $RuntimeOptions): UpdatePublicPatchBaselineResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.approvalRules)) {
    query['ApprovalRules'] = request.approvalRules;
  }
  if (!$isNull(request.clientToken)) {
    query['ClientToken'] = request.clientToken;
  }
  if (!$isNull(request.description)) {
    query['Description'] = request.description;
  }
  if (!$isNull(request.name)) {
    query['Name'] = request.name;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdatePublicPatchBaseline',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdatePublicPatchBaselineRequest
 * @return UpdatePublicPatchBaselineResponse
 */
async function updatePublicPatchBaseline(request: UpdatePublicPatchBaselineRequest): UpdatePublicPatchBaselineResponse {
  var runtime = new $RuntimeOptions{};
  return updatePublicPatchBaselineWithOptions(request, runtime);
}

model UpdatePublicTemplateRequest {
  category?: string(name='Category'),
  content?: string(name='Content', description='This parameter is required.'),
  popularity?: int32(name='Popularity'),
  publisher?: string(name='Publisher'),
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName', description='This parameter is required.'),
  versionName?: string(name='VersionName'),
}

model UpdatePublicTemplateResponseBody = {
  requestId?: string(name='RequestId'),
  template?: {
    category?: string(name='Category'),
    createdBy?: string(name='CreatedBy'),
    createdDate?: string(name='CreatedDate'),
    description?: string(name='Description'),
    hash?: string(name='Hash'),
    popularity?: int32(name='Popularity'),
    shareType?: string(name='ShareType'),
    templateFormat?: string(name='TemplateFormat'),
    templateId?: string(name='TemplateId'),
    templateName?: string(name='TemplateName'),
    templateVersion?: string(name='TemplateVersion'),
    updatedBy?: string(name='UpdatedBy'),
    updatedDate?: string(name='UpdatedDate'),
  }(name='Template'),
}

model UpdatePublicTemplateResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: UpdatePublicTemplateResponseBody(name='body'),
}

/**
 * @param request UpdatePublicTemplateRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return UpdatePublicTemplateResponse
 */
async function updatePublicTemplateWithOptions(request: UpdatePublicTemplateRequest, runtime: $RuntimeOptions): UpdatePublicTemplateResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.category)) {
    query['Category'] = request.category;
  }
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.popularity)) {
    query['Popularity'] = request.popularity;
  }
  if (!$isNull(request.publisher)) {
    query['Publisher'] = request.publisher;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.versionName)) {
    query['VersionName'] = request.versionName;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'UpdatePublicTemplate',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request UpdatePublicTemplateRequest
 * @return UpdatePublicTemplateResponse
 */
async function updatePublicTemplate(request: UpdatePublicTemplateRequest): UpdatePublicTemplateResponse {
  var runtime = new $RuntimeOptions{};
  return updatePublicTemplateWithOptions(request, runtime);
}

model ValidatePublicTemplateContentRequest {
  content?: string(name='Content', description='This parameter is required.'),
  regionId?: string(name='RegionId'),
  templateName?: string(name='TemplateName'),
  type?: string(name='Type', description='This parameter is required.'),
}

model ValidatePublicTemplateContentResponseBody = {
  description?: string(name='Description'),
  outputs?: string(name='Outputs'),
  parameters?: string(name='Parameters'),
  ramRole?: string(name='RamRole'),
  requestId?: string(name='RequestId'),
  tasks?: [ 
    {
      description?: string(name='Description'),
      name?: string(name='Name'),
      outputs?: string(name='Outputs'),
      properties?: string(name='Properties'),
      type?: string(name='Type'),
    }
  ](name='Tasks'),
}

model ValidatePublicTemplateContentResponse = {
  headers?: map[string]string(name='headers'),
  statusCode?: int32(name='statusCode'),
  body?: ValidatePublicTemplateContentResponseBody(name='body'),
}

/**
 * @param request ValidatePublicTemplateContentRequest
 * @param runtime runtime options for this request RuntimeOptions
 * @return ValidatePublicTemplateContentResponse
 */
async function validatePublicTemplateContentWithOptions(request: ValidatePublicTemplateContentRequest, runtime: $RuntimeOptions): ValidatePublicTemplateContentResponse {
  request.validate();
  var query = {};
  if (!$isNull(request.content)) {
    query['Content'] = request.content;
  }
  if (!$isNull(request.regionId)) {
    query['RegionId'] = request.regionId;
  }
  if (!$isNull(request.templateName)) {
    query['TemplateName'] = request.templateName;
  }
  if (!$isNull(request.type)) {
    query['Type'] = request.type;
  }
  var req = new OpenApiUtil.OpenApiRequest{ 
    query = OpenApiUtil.query(query),
  };
  var params = new OpenApiUtil.Params{
    action = 'ValidatePublicTemplateContent',
    version = '2019-06-01',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  if ($isNull(@signatureVersion) || @signatureVersion != 'v4') {
    return callApi(params, req, runtime);
  } else {
    return execute(params, req, runtime);
  }
}

/**
 * @param request ValidatePublicTemplateContentRequest
 * @return ValidatePublicTemplateContentResponse
 */
async function validatePublicTemplateContent(request: ValidatePublicTemplateContentRequest): ValidatePublicTemplateContentResponse {
  var runtime = new $RuntimeOptions{};
  return validatePublicTemplateContentWithOptions(request, runtime);
}

